package vip.liux.contracts.shared.enums.pay;

import vip.liux.core.enums.IEnum;

import java.util.Objects;

/**
 * 示例提现单的状态枚举
 *
 * @author jason
 */
public enum PayDemoWithdrawStatus implements IEnum {

    WAITING(0, "等待提现"),
    SUCCESS(1, "提现成功"),
    CLOSED(2, "提现关闭");

    /**
     * 类型
     */
    private final int value;
    /**
     * 名字
     */
    private final String desc;

    PayDemoWithdrawStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static boolean isSuccess(PayDemoWithdrawStatus status) {
        return Objects.equals(status, SUCCESS);
    }

    public static boolean isClosed(PayDemoWithdrawStatus status) {
        return Objects.equals(status, CLOSED);
    }

    public static boolean isWaiting(PayDemoWithdrawStatus status) {
        return Objects.equals(status, WAITING);
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
